/* Do we need this for ie? */
document.createElement('header');
document.createElement('footer');
document.createElement('section');
document.createElement('aside');
document.createElement('nav');
document.createElement('article');


$(function() {          
	$("#container .photo ul li img").lazyload({
		effect      : "fadeIn",
		threshold : 300
	});
});

function stickyElement()
{
	if( $('body #articles article').offset().top < $( window ).scrollTop() ) {
		$( 'body #articles article header'  ).css( 'position', 'fixed' );
	} else {
		$( 'body #articles article header'  ).css( 'position', 'relative' );
	}
}


$(document).ready (function(){


	$( window ).scroll( function(){	
			stickyElement();
	});

	$( 'body > header' ).fadeScroll( { begin: 100, full: 50 });

	$( 'body > header > nav' ).css( 'position', 'fixed' );

	$( 'body > footer' ).css( 'position', 'fixed' );

	$( 'body > footer' ).fadeScroll( { begin: 200, full: 0, opacity: 0.3, minheight: 15, bottom: true, move: true} );
		
	/*
	 * Make the code blocks look a bit nice.
	 */ 
	$( ".geshicode" ).css( "overflow-x", "hidden" );
	$( ".geshicode" ).hover(
      function () {
        $( this ).css( "overflow-x", "scroll" );
      }, 
      function () {
        $( this ).css( "overflow-x", "hidden" );
      }
    );

});

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-11067983-1");
pageTracker._trackPageview();
} catch(err) {}
